package com.ilearn.study;

import java.util.Map;

/**
 * @Project: edb
 * @Description:
 * @Version 1.0
 * @Throws :
 * @Author: <li>2019/4/11 lyndon Create 1.0
 * @Copyright (c)2018-2018 中央结算公司，版权所有
 * @Modified By:
 */
public class RegexUtil {


    public static String paramsHandler(String url, Map<String, String> params) {
        String targetUrl = url;
        if (params != null && !(params.isEmpty())) {
            for (String param : params.keySet()) {
                String paramName = new StringBuffer().append("#").append("\\{").append(param).append("\\}").toString();
                targetUrl = targetUrl.replaceAll(paramName, params.get(param));
                System.out.println("targetUrl:" + targetUrl);
            }
        }
        return targetUrl;
    }


}
